package com.ktg.web.wms;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ktg.ktgcommon.aop.SecuredOperation;
import com.ktg.ktgcommon.domain.wms.WmStorageLocation;
import com.ktg.ktgcommon.result.R;
import com.ktg.service.WasStoRageService;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/api/wmsSto")
public class WasStoController {
    @Resource
    WasStoRageService wasStoService;
    @PostMapping("/list")
    @SecuredOperation("wm:sto:list")
    public R pageInfo(@RequestParam(defaultValue = "1") Integer pageNo,
                      @RequestParam(defaultValue = "10") Integer pageSize,@RequestBody WmStorageLocation wmStorageLocation){
        Page<WmStorageLocation> wmWarehousePage = new Page<>(pageNo, pageSize);
        Page<WmStorageLocation> wmWarehousePage1 = wasStoService.getUserByPage(wmWarehousePage, wmStorageLocation.getWarehouseId(),wmStorageLocation);
        if (wmWarehousePage1 != null) {
            return R.OK(wmWarehousePage1);
        }
        return R.FAIL();
    }
}
